/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Hnmtuan
 */
@Entity
@Table(name = "employee_logs")
@NamedQueries({
    @NamedQuery(name = "EmployeeLogs.findAll", query = "SELECT e FROM EmployeeLogs e"),
    @NamedQuery(name = "EmployeeLogs.findByIdEmpLog", query = "SELECT e FROM EmployeeLogs e WHERE e.idEmpLog = :idEmpLog"),
    @NamedQuery(name = "EmployeeLogs.findByChangeTime", query = "SELECT e FROM EmployeeLogs e WHERE e.changeTime = :changeTime")})
public class EmployeeLogs implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idEmpLog")
    private String idEmpLog;
    @Column(name = "ChangeTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date changeTime;
    @Lob
    @Column(name = "Notes")
    private String notes;
    @JoinColumn(name = "Employee", referencedColumnName = "idEmp")
    @ManyToOne(optional = false)
    private Employee employee;

    public EmployeeLogs() {
    }

    public EmployeeLogs(String idEmpLog) {
        this.idEmpLog = idEmpLog;
    }

    public String getIdEmpLog() {
        return idEmpLog;
    }

    public void setIdEmpLog(String idEmpLog) {
        this.idEmpLog = idEmpLog;
    }

    public Date getChangeTime() {
        return changeTime;
    }

    public void setChangeTime(Date changeTime) {
        this.changeTime = changeTime;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEmpLog != null ? idEmpLog.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmployeeLogs)) {
            return false;
        }
        EmployeeLogs other = (EmployeeLogs) object;
        if ((this.idEmpLog == null && other.idEmpLog != null) || (this.idEmpLog != null && !this.idEmpLog.equals(other.idEmpLog))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.EmployeeLogs[idEmpLog=" + idEmpLog + "]";
    }

}
